package cn.polymhomework03;



import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        @SuppressWarnings("resource")
        Scanner scanner=new Scanner(System.in);
        System.out.print("输入第一个数：");
        double x=scanner.nextInt();
        System.out.print("输入操作符(+、—、*、/)：");
        String oper=scanner.next();
        System.out.print("输入第二个数：");
        double y=scanner.nextInt();
        Calculator operation = CalculatorFactory.creatOperation(oper);
        operation.setX(x);
        operation.setY(y);
        double result = operation.getResult();
        System.out.println("结果："+result);
    }
}

